package com.starinside.wp.domain.familyTest;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.starinside.wp.domain.Domain;
import lombok.Data;
import org.hibernate.annotations.CollectionId;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.util.Date;
import java.util.List;

@Data
@Entity
@Table(name = "m_test_storeObsPointScore", uniqueConstraints = {
        @UniqueConstraint(columnNames = {"taskId", "obsPointId "})
})

public class TestStoreObsPointScore extends Domain {

    @Column
    Integer testStoreId;

//    @ManyToOne
//    @JoinColumn(name = "taskId")
//    @JsonIgnore
//    TestStoreObsTask testTask;
    @Column
    String taskId;

    @Column
    Integer obsPointId;

    @Column
    Integer obsPointType;

    @Column
    String teacherId;

    @Column
    String parentId;

    @Column
    String childrenId;

    @Column
    Integer obsPointOptionId;

    @Column
    Integer score;

    @Column
    Byte month;

    @Column
    String contents;


    public static  TestStoreObsPointScore of(Integer testStoreId, String taskId, Integer obsPointId, Integer obsPointType, String parentId, String childrenId, Integer obsPointOptionId, Integer s, Byte month, String content) {
        TestStoreObsPointScore score = new TestStoreObsPointScore();
        score.testStoreId = testStoreId;
        score.taskId = taskId;
        score.obsPointId = obsPointId;
        score.obsPointType = obsPointType;
        score.parentId = parentId;
        score.childrenId = childrenId;
        score.obsPointOptionId = obsPointOptionId;
        score.score = s;
        score.month = month;
        score.contents = content;
        return score;
    }

}
